func maxProfit(prices []int, fee int) int {
    minPrice := prices[0]
    result := 0
    for i:=0; i<len(prices); i++ {
        if prices[i] < minPrice { // 情况1：遇到最小值买入
            minPrice = prices[i]
        }

        if prices[i] - minPrice <= fee {
            continue
        }
        
        if prices[i] - minPrice > fee {
            result += prices[i] - minPrice - fee
            minPrice = prices[i] - fee
        }
    }

    return result
}